//
//  TeamSearchFileCell.swift
//  NETeamUIKit
//
//  Created by Laura on 2024/7/31.
//


import NIMSDK
import UIKit

@objcMembers
open class TeamSearchFileCell: NEBaseTeamSearchFileCell {
  override open func setupSubviews() {
    super.setupSubviews()
      
      NSLayoutConstraint.activate([
        nameLabel.leftAnchor.constraint(equalTo: contentView.leftAnchor, constant: kScreenInterval),
        nameLabel.rightAnchor.constraint(equalTo: contentView.rightAnchor, constant: -kScreenInterval),
        nameLabel.topAnchor.constraint(equalTo: contentView.topAnchor, constant: 12),
        nameLabel.heightAnchor.constraint(equalToConstant: 22)
      ])

      
    NSLayoutConstraint.activate([
      fileImageView.leftAnchor.constraint(equalTo: contentView.leftAnchor, constant: kScreenInterval),
      fileImageView.topAnchor.constraint(equalTo: nameLabel.bottomAnchor, constant: 12),
      fileImageView.widthAnchor.constraint(equalToConstant: 40),
      fileImageView.heightAnchor.constraint(equalToConstant: 40),
    ])


    NSLayoutConstraint.activate([
      fileNameLabel.leftAnchor.constraint(equalTo: fileImageView.rightAnchor, constant: 12),
      fileNameLabel.rightAnchor.constraint(equalTo: contentView.rightAnchor, constant: -kScreenInterval),
      fileNameLabel.topAnchor.constraint(equalTo: fileImageView.topAnchor),
      fileNameLabel.heightAnchor.constraint(equalToConstant: 20)
    ])

    NSLayoutConstraint.activate([
        sizeLabel.leftAnchor.constraint(equalTo: fileNameLabel.leftAnchor),
        sizeLabel.rightAnchor.constraint(equalTo: fileNameLabel.rightAnchor),
        sizeLabel.bottomAnchor.constraint(equalTo: fileImageView.bottomAnchor),
        sizeLabel.heightAnchor.constraint(equalToConstant: 18),
    ])

    NSLayoutConstraint.activate([
      timeLabel.rightAnchor.constraint(equalTo: nameLabel.rightAnchor),
      timeLabel.topAnchor.constraint(equalTo: nameLabel.topAnchor),
      timeLabel.leftAnchor.constraint(equalTo: nameLabel.leftAnchor),
      timeLabel.heightAnchor.constraint(equalTo: nameLabel.heightAnchor),
    ])
      
    NSLayoutConstraint.activate([
        bottomLine.leftAnchor.constraint(equalTo: contentView.leftAnchor, constant: kScreenInterval),
        bottomLine.rightAnchor.constraint(equalTo: contentView.rightAnchor, constant: -kScreenInterval),
        bottomLine.bottomAnchor.constraint(equalTo: contentView.bottomAnchor),
        bottomLine.heightAnchor.constraint(equalToConstant: 0.5)
    ])
  }

  override open func configData(message: HistoryMessageModel) {
    super.configData(message: message)
  }
}
